.class public final Lcom/burstly/lib/ui/AdRequestCallback;
.super Lcom/burstly/lib/network/request/DefaultRequestCallback;
.source "AdRequestCallback.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/burstly/lib/network/request/DefaultRequestCallback",
        "<",
        "Lcom/burstly/lib/network/beans/ResponseBean;",
        ">;"
    }
.end annotation


# instance fields
.field private final mBurstlyView:Ljava/lang/ref/Reference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/Reference",
            "<",
            "Lcom/burstly/lib/ui/BurstlyView;",
            ">;"
        }
    .end annotation
.end field

.field private final mClientTargetParams:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private final mPrecacheRequest:Z

.field private mQueueElements:Ljava/util/Collection;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Collection",
            "<",
            "Lcom/burstly/lib/component/ComponentQueueElement;",
            ">;"
        }
    .end annotation
.end field

.field private final mRequestData:Lcom/burstly/lib/network/beans/RequestData;


# direct methods
.method constructor <init>(Lcom/burstly/lib/ui/BurstlyView;)V
    .locals 1
    .parameter "burstlyView"

    .prologue
    .line 69
    invoke-direct {p0}, Lcom/burstly/lib/network/request/DefaultRequestCallback;-><init>()V

    .line 70
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mBurstlyView:Ljava/lang/ref/Reference;

    .line 71
    invoke-virtual {p1}, Lcom/burstly/lib/ui/BurstlyView;->isPrecacheRequest()Z

    move-result v0

    iput-boolean v0, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mPrecacheRequest:Z

    .line 72
    invoke-virtual {p1}, Lcom/burstly/lib/ui/BurstlyView;->getRequestData()Lcom/burstly/lib/network/beans/RequestData;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mRequestData:Lcom/burstly/lib/network/beans/RequestData;

    .line 73
    invoke-virtual {p1}, Lcom/burstly/lib/ui/BurstlyView;->getClientTargetParams()Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mClientTargetParams:Ljava/util/Map;

    .line 74
    return-void
.end method

.method private static logGarbageCollected()V
    .locals 4

    .prologue
    .line 134
    sget-object v0, Lcom/burstly/lib/ui/BurstlyView;->sLog:Lcom/burstly/lib/util/LoggerExt;

    const-string v1, "AdRequestCallback"

    const-string v2, "Burstly view instance has been garbage collected. Skip response processing."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 136
    return-void
.end method


# virtual methods
.method public getQueueElements()Ljava/util/Collection;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Collection",
            "<",
            "Lcom/burstly/lib/component/ComponentQueueElement;",
            ">;"
        }
    .end annotation

    .prologue
    .line 126
    iget-object v0, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mQueueElements:Ljava/util/Collection;

    return-object v0
.end method

.method public onFailUi(Lcom/burstly/lib/network/beans/ResponseBean;)V
    .locals 5
    .parameter "param"

    .prologue
    .line 101
    iget-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mBurstlyView:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 102
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_0

    .line 103
    invoke-static {}, Lcom/burstly/lib/ui/AdRequestCallback;->logGarbageCollected()V

    .line 108
    :goto_0
    return-void

    .line 106
    :cond_0
    sget-object v1, Lcom/burstly/lib/ui/BurstlyView;->sLog:Lcom/burstly/lib/util/LoggerExt;

    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Malformed server response!"

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 107
    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->startDelayedRequest()V

    goto :goto_0
.end method

.method public bridge synthetic onFailUi(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 37
    check-cast p1, Lcom/burstly/lib/network/beans/ResponseBean;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/ui/AdRequestCallback;->onFailUi(Lcom/burstly/lib/network/beans/ResponseBean;)V

    return-void
.end method

.method public onNoConnection()V
    .locals 2

    .prologue
    .line 112
    iget-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mBurstlyView:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 113
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_0

    .line 114
    invoke-static {}, Lcom/burstly/lib/ui/AdRequestCallback;->logGarbageCollected()V

    .line 118
    :goto_0
    return-void

    .line 117
    :cond_0
    iget-object v1, v0, Lcom/burstly/lib/ui/BurstlyView;->mInnerWrapper:Lcom/burstly/lib/component/IInternalBurstlyAdListener;

    invoke-interface {v1}, Lcom/burstly/lib/component/IInternalBurstlyAdListener;->failedToDisplayAds()V

    goto :goto_0
.end method

.method public onSuccessInBackground(Lcom/burstly/lib/network/beans/ResponseBean;)V
    .locals 4
    .parameter "processResult"

    .prologue
    .line 78
    iget-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mBurstlyView:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 79
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_0

    .line 80
    invoke-static {}, Lcom/burstly/lib/ui/AdRequestCallback;->logGarbageCollected()V

    .line 86
    :goto_0
    return-void

    .line 83
    :cond_0
    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v2

    iget-object v3, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mRequestData:Lcom/burstly/lib/network/beans/RequestData;

    invoke-static {v1, v2, p1, v3}, Lcom/burstly/lib/component/ComponentFactory;->getComponents(Landroid/content/Context;Ljava/lang/String;Lcom/burstly/lib/network/beans/ResponseBean;Lcom/burstly/lib/network/beans/RequestData;)Ljava/util/Collection;

    move-result-object v1

    iput-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mQueueElements:Ljava/util/Collection;

    .line 85
    invoke-virtual {p1}, Lcom/burstly/lib/network/beans/ResponseBean;->getCookie()[Lcom/burstly/lib/network/beans/cookie/CookieHolder;

    move-result-object v1

    invoke-static {v1}, Lcom/burstly/lib/network/beans/cookie/CookieManager;->saveCookies([Lcom/burstly/lib/network/beans/cookie/CookieHolder;)V

    goto :goto_0
.end method

.method public bridge synthetic onSuccessInBackground(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 37
    check-cast p1, Lcom/burstly/lib/network/beans/ResponseBean;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/ui/AdRequestCallback;->onSuccessInBackground(Lcom/burstly/lib/network/beans/ResponseBean;)V

    return-void
.end method

.method public onSuccessUi(Lcom/burstly/lib/network/beans/ResponseBean;)V
    .locals 5
    .parameter "param"

    .prologue
    .line 90
    iget-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mBurstlyView:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 91
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_0

    .line 92
    invoke-static {}, Lcom/burstly/lib/ui/AdRequestCallback;->logGarbageCollected()V

    .line 97
    :goto_0
    return-void

    .line 95
    :cond_0
    iget-boolean v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mPrecacheRequest:Z

    invoke-virtual {v0, v1}, Lcom/burstly/lib/ui/BurstlyView;->setPrecacheRequest(Z)V

    .line 96
    iget-object v1, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mQueueElements:Ljava/util/Collection;

    iget-object v2, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mRequestData:Lcom/burstly/lib/network/beans/RequestData;

    iget-object v3, p0, Lcom/burstly/lib/ui/AdRequestCallback;->mClientTargetParams:Ljava/util/Map;

    const/4 v4, 0x1

    invoke-virtual {v0, v1, v2, v3, v4}, Lcom/burstly/lib/ui/BurstlyView;->startMainQueue(Ljava/util/Collection;Lcom/burstly/lib/network/beans/RequestData;Ljava/util/Map;Z)V

    goto :goto_0
.end method

.method public bridge synthetic onSuccessUi(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 37
    check-cast p1, Lcom/burstly/lib/network/beans/ResponseBean;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/ui/AdRequestCallback;->onSuccessUi(Lcom/burstly/lib/network/beans/ResponseBean;)V

    return-void
.end method
